import { getQuestionDetail } from "../../../../api.js"
Page({
  data: {

  },
  onLoad(options) {
    let { id } = options
    if (id) {
      this.init(id)
    }
  },
  // 获取问题详情
  init(id) {
    let businessId = getApp().globalData.Store.business.id
    getQuestionDetail(id, businessId).then(res => {
      if (res.data.code === 666) {
        this.setData({
          question: res.data.data[0]
        })
      } else {
        wx.showToast({
          title: res.data.msg,
          icon: "none"
        })
      }
    })
  },
  onShow() {
    getApp().startpage(new Date().getTime())
  },
  onHide() {
    getApp().endpage(new Date().getTime())
  }
})